﻿using System.Web.Mvc;
using Autofac;
using Autofac.Integration.Mvc;

using NeGroid.ChampionshipManager.Persistance;

namespace NeGroid.ChampionshipManager.Web.App_Start
{
	public static class AutofacConfig
	{
		public static void RegisterModules()
		{
			var builder = new ContainerBuilder();
			builder.RegisterControllers(typeof(MvcApplication).Assembly);
			builder.RegisterModule(new PersistanceModule());
			var container = builder.Build();
			DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
		}
	}
}